package com.leo.m1803.d27;

import java.util.Scanner;

/**
 * Created by LEO on 2018/3/27.
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int i = sc.nextInt();
        int ans = 0, x;
        System.out.println(a(l,  i));
//        System.out.println(a(2,  5));

    }

    /**
     *
     * @param l 左端
     * @param i 右端
     * @return
     */
    private static int a(int l, int i){
        int res = 0;//结果
        int still = 0;//剩余值，小于3。每个能被三整出的数必然各个位加起来是3的倍数
        //算之前的剩余值
        for (int j = 0; j < l; j++) {
            still +=j;
            still %= 3;
        }
        //算加上每个数是否能被3整出
        for (int j = l; j <= i; j++) {
            still += j;
            still %= 3;
            if (still == 0){
                res++;
            }
        }
        return res;
    }
}
